//
// Created by (cie_tea)15694 on 2024/5/23.
//
#ifndef SESSION_H
#define SESSION_H

#include <map>
#include "../utils/IoBuffer.h"
#include "IdleStatus.h"
#include <chrono>
//typedef long long time_t;

class Session {
protected:
    std::map <std::string, std::string> sessionConfigs;

public:
    //    SOCKADDR_IN addrLocal;            // 连接的本地地址
    //    SOCKADDR_IN addrRemote;            // 连接的远程地址
    int fd = -1;
    int sessionId = -1;
    IoBuffer *recvBuffer;
    IoBuffer *sendBuffer;
    IdleStatus *idleStatus;
    int lastMsgTime;


public:
    Session();
    ~Session();
    explicit Session(int sessionId);
    IoBuffer *getRecvBuffer() const;
    IoBuffer *getSendBuffer() const;
};

#endif